const path = require('path')

module.exports = {
  // 多入口
  entry: {
    react: './react_src/react_app.js',
    vue: './vue_src/vue_app.js'
  },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name]_app.js'
  },
  module: {
    rules: [{
      // react配置
      test: /\.js$/,
      exclude: /(node_modules|vue_src)/,
      use: {
        loader: 'babel-loader',
        options: {
          presets: ['env', 'react']
        }
      }
    }, {
      // vue配置
      test: /\.js$/,
      exclude: /(node_modules|react_src)/,
      loader: 'babel-loader',
      options: {
        presets: ['env']
      }
    }, {
      // vue配置
      test: /\.vue$/,
      exclude: /(node_modules|react_src)/,
      loader: 'vue-loader'
    }]
  },
  // vue
  resolve: {
    alias: {
      'vue': 'vue/dist/vue.js'
    }
  }
}
